import request from '@/utils/request'

export function page(name,gender,begin,end,page,pageSize) {
  return request({
    url: '/staffs/likeSearchPage?keywords='+name+'&gender='+gender+'&begin='+begin+'&end='+end+'&pageNum='+page+'&pageSize='+pageSize,
    method: 'get'
  })
}

export function add(emp) {
  return request({
    url: '/staffs',
    method: 'post',
    data: emp
  })
}

export function update(dept) {
  return request({
    url: '/staffs',
    method: 'put',
    data: dept
  })
}


export function deleteById(id) {
  return request({
    url: '/staffs',
    method: 'delete',
    data: id,
  })
}
export function deleteBatch(idList){
  return request({
    url: '/staffs/batch',
    method: 'delete',
    data: idList
  })
}
export function exportEmp(){
  // window.location.href = "http://localhost:8080/api/staffs/export";
  return request({
    url: '/staffs/export',
    method: 'get'
  })
}
export function importEmp(data){
  return request({
    url: '/staffs/batchImport',
    method: 'post',
    data: data
  })
}
export function selectById(id) {
  return request({
    url: '/staffs/'+id,
    method: 'get',
  })
}

